Sell your soul
Believeth in me an hath everlasting life
Sharp Stuff
Switchblades Icepicks and german knives
Viking gear
Gear Gifts and Apparel
Till death do us part
Axels New Music releases

here are some of the best and useful php scripts and snippets to help in your projects. Php displayed below. Use the search for specific script lookups. Click the category links to view scripts in Javascript and cgi. To add your own script click the link and add your useful script example.

Ways to regulate data and limit using a timestamp comparision

compare regulate by time timestamp
compare-timestamps date added Jan 2013

<?php
function time_is_older_than($t$check_time){
 
    
$t strt
olower
($t);
    
$time_type substr(preg_replace('/[^a-z]/'''$t),
 
01);
    
$val intval(preg_replace('/[^0-9]/'''$t));
    
$ts
 
0;
 
    
// (s)econds, (m)inutes, (d)ays, (y)ears
    
if ($time_
type 
== 's'){ $ts $val; }
    else if (
$time_type == 'm'){ $ts $v
al 
60; }
    else if (
$time_type == 'h'){ $ts $val 60 60; }

    else if (
$time_type == 'd'){ $ts $val 60 60 24; }
    
els
if ($time_type == 'y'){ $ts $val 60 60 24 365; }
    else
 { die(
'Unknown time format given!'); }
 
    if (
$check_time < (tim
e
()-$ts)){ return true; }
 
    return 
false;
}

?>


Add your comment.













No comments yet

Search ScriptsnTips


Php JavaScripts CGI/Perl